from flask import Blueprint
from .user import UserRoute

# 创建API蓝图
api_bp = Blueprint('api', __name__, url_prefix='/api')

def init_routes(app, container):
    """初始化API路由"""
    # 创建路由实例列表
    routes = [
        UserRoute()
    ]
    
    # 注册所有路由
    blueprints = []
    for route in routes:
        bp = route.register_routes(container)
        blueprints.append(bp)
    
    # 注册所有蓝图
    for bp in blueprints:
        app.register_blueprint(bp)
